using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class SO_PHYSICIAN_TotalMap : EntityTypeConfiguration<SO_PHYSICIAN_Total>
    {
        public SO_PHYSICIAN_TotalMap()
        {
            // Primary Key
            this.HasKey(t => new { t.PHYSICIAN_ID, t.SUMFIELDS });

            // Properties
            this.Property(t => t.BILL_NUMBER)
                .HasMaxLength(8);

            this.Property(t => t.Trans_id)
                .HasMaxLength(8);

            this.Property(t => t.PHYSICIAN_ID)
                .IsRequired()
                .HasMaxLength(6);

            this.Property(t => t.SUMFIELDS)
                .IsRequired()
                .HasMaxLength(63);

            // Table & Column Mappings
            this.ToTable("SO_PHYSICIAN_Total");
            this.Property(t => t.BILL_NUMBER).HasColumnName("BILL_NUMBER");
            this.Property(t => t.Trans_id).HasColumnName("Trans_id");
            this.Property(t => t.PHYSICIAN_ID).HasColumnName("PHYSICIAN_ID");
            this.Property(t => t.CURRENCY).HasColumnName("CURRENCY");
            this.Property(t => t.PHYSICIAN_TOTAL_AMOUNT).HasColumnName("PHYSICIAN_TOTAL_AMOUNT");
            this.Property(t => t.PHYSICIAN_GUARANTOR1_AMOUNT).HasColumnName("PHYSICIAN_GUARANTOR1_AMOUNT");
            this.Property(t => t.PHYSICIAN_GUARANTOR2_AMOUNT).HasColumnName("PHYSICIAN_GUARANTOR2_AMOUNT");
            this.Property(t => t.PHYSICIAN_TOTAL_AMOUNT_BASE1).HasColumnName("PHYSICIAN_TOTAL_AMOUNT_BASE1");
            this.Property(t => t.PHYSICIAN_TOTAL_AMOUNT_BASE2).HasColumnName("PHYSICIAN_TOTAL_AMOUNT_BASE2");
            this.Property(t => t.PHYSICIAN_GUARANTOR1_AMOUNT_BASE1).HasColumnName("PHYSICIAN_GUARANTOR1_AMOUNT_BASE1");
            this.Property(t => t.PHYSICIAN_GUARANTOR1_AMOUNT_BASE2).HasColumnName("PHYSICIAN_GUARANTOR1_AMOUNT_BASE2");
            this.Property(t => t.PHYSICIAN_GUARANTOR2_AMOUNT_BASE1).HasColumnName("PHYSICIAN_GUARANTOR2_AMOUNT_BASE1");
            this.Property(t => t.PHYSICIAN_GUARANTOR2_AMOUNT_BASE2).HasColumnName("PHYSICIAN_GUARANTOR2_AMOUNT_BASE2");
            this.Property(t => t.SUMFIELDS).HasColumnName("SUMFIELDS");
        }
    }
}
